package com.dx.VegetableOxygenBarBackEnd.service;

import com.dx.VegetableOxygenBarBackEnd.model.domain.dto.TeamQuery;
import com.dx.VegetableOxygenBarBackEnd.model.domain.entity.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dx.VegetableOxygenBarBackEnd.model.domain.entity.User;
import com.dx.VegetableOxygenBarBackEnd.model.domain.request.TeamAddRequest;
import com.dx.VegetableOxygenBarBackEnd.model.domain.request.TeamJoinRequest;
import com.dx.VegetableOxygenBarBackEnd.model.domain.request.TeamQuitRequest;
import com.dx.VegetableOxygenBarBackEnd.model.domain.request.TeamUpdateRequest;
import com.dx.VegetableOxygenBarBackEnd.model.domain.vo.TeamUserVo;
import com.dx.VegetableOxygenBarBackEnd.model.domain.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author dengxiao
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-08-29 10:54:46
*/
public interface TeamService extends IService<Team> {
    /**
     * 增加队伍
     * @param team 新增队伍参数
     * @param loginUser 当前登录用户
     * @return 新增队伍id
     */
    long addTeam(Team team, User loginUser);

    //todo 关联查询已经加入队伍的用户
    /**
     * 查询已经在当前队伍的用户
     * @param teamId 当前队伍id
     * @return 用户列表
     */
    List<UserVo> listUserInTeam(long teamId);

    /**
     * 查询队伍列表
     * @param teamQuery 查询列表参数
     * @return 队伍用户信息
     */
    List<TeamUserVo> listTeam(TeamQuery teamQuery,Boolean isAdmin);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest,User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param loginUser
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest,User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamId
     * @return
     */
    boolean deleteTeam(long teamId,User loginUser);
}
